$(function () {
    //持久化文件类型
    findAllVolClass();
    //持久化保管期限
    findStorageTime();
    //持久化密级
    secretLevelAction();
    //持久化组织机构
    orgListAction();
});
/**
 *	加载文件类型
 */
/* 档案类型持久化 */
var archiveType={};
function findAllVolClass(){
    $.post(BASE_PATH+"/pcwindow/findType/findTypeBySortNum",function(data){
        for(var i=0;i<data.length;i++){
            var code = data[i].sortNum;
            var title = data[i].sortName;
            archiveType[code] = title;
        }
    });
}
/**
 *	加载所有保管期限
 */
var storageTime={};
function findStorageTime(){
    $.ajax({
        type: "POST",
        url:BASE_PATH+"/pcwindow/findAllStorageTime",
        dataType:"json",
        async:false,
        success: function(data){
            if (data.length != 0) {
                var arcStorageTime = data.rows;
                for(var i = 0;i < arcStorageTime.length ;i++){
                    var tyname=arcStorageTime[i].description;
                    var tyid=arcStorageTime[i].code;
                    storageTime[tyid]=tyname;
                }
            }
        }
    });
}
/**
 * 加载数据字典中的密级
 */
//存放密级
var secretLevel={};
function secretLevelAction(){
    $.ajax({
        type: "POST",
        url:BASE_PATH+"/pcwindow/findAllSecretLevel",
        dataType:"json",
        async:false,
        success: function(data){
            if (data.length != 0) {
                var secretLevelData = data.rows;
                for(var i = 0;i < secretLevelData.length ;i++){
                    var name=secretLevelData[i].description;
                    var id=secretLevelData[i].code;
                    secretLevel[id]=name;
                }
            }
        }
    });
}
//存放组织机构(归档单位)
var orgList={};
function orgListAction() {
    $.ajax({
        type: "POST",
        url: BASE_PATH + "/manage/organization/findAllOrgList",
        dataType: "json",
        async: false,
        success: function (data) {
            if (data.length != 0) {
                var orgData = data.rows;
                for (var i = 0; i < orgData.length; i++) {
                    var orgName = orgData[i].name;
                    var orgId = orgData[i].organizationId;
                    orgList[orgId] = orgName;
                }
            }
        }
    });

}